/*
 * @Author: zhangshu
 * @email: shiliang.zhang@tuya.com
 * @LastEditors: Please set LastEditors
 * @file name: app_key.h
 * @Description: 
 * @Copyright: HANGZHOU TUYA INFORMATION TECHNOLOGY CO.,LTD
 * @Company: http://www.tuya.com
 * @Date: 2022-02-08
 * @LastEditTime: 2022-02-08
 */
#ifndef __APP_KEY_H__
#define __APP_KEY_H__

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

#include "app_common.h"
#include "tuya_hal_gpio.h"

/**
 * @description: key init
 * @param[in] config: key config
 * @return: OPERATE_RET, success when OPRT_OK, or else
 */
OPERATE_RET app_key_oem_init(key_config_t * config);

/**
 * @description: net key press process
 * @param[in] time_ms: key press time in ms
 * @return: none
 */
VOID_T net_key_press_callback(UINT32_T time_ms);

/**
 * @description: long press and release time in ms
 * @param[in] time_ms: key press time in ms
 * @return: none
 */
VOID_T net_key_long_press_release_callback(UINT32_T time_ms);

/**
 * @description: short press and release time in ms
 * @param[in] count: click times
 * @return: none
 */
VOID_T net_key_short_press_release_callback(UINT8_T count);

//key irq handler
VOID_T gpio_key_interrupt_handler(UINT32_T key_id, KEY_ST_T key_st, UINT32_T push_time);

#ifdef __cplusplus
}
#endif

#endif
